define [ 'fizz' ], (fizz) ->
  class extends fizz.Model
  
    urlRoot : 'rest/roles',
    
    defaults :
      # Code
      code : '',
      # Label
      label : ''
      
    validate : (attrs) ->
      errors = [];
      unless attrs.code?.length
        errors.push 'role.validation.emptyCode'
      if errors.length
        return errors
      null
    
    toString : () ->
      @get 'code'
